package net.rlair.sbdemo.controller;

import net.rlair.sbdemo.ContextUtils;
import net.rlair.sbdemo.dao.mybatis.bootmapper.YangHaikunUserMapper;
import net.rlair.sbdemo.dao.mybatis.boottwomapper.YangHaikunMerchantMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author lixudong
 */
@Controller
@RequestMapping("yanghaikun")
public class YangHaikunController {

    @Autowired
    private YangHaikunUserMapper yangHaikunUserMapper;

    @Autowired
    private YangHaikunMerchantMapper yangHaikunMerchantMapper;

    @Resource
    private ContextUtils contextUtils;

    @GetMapping("list/user")
    @ResponseBody
    public Object yangHaikunListUser() {
        return yangHaikunUserMapper.selectAll();
    }

    @GetMapping("list/merchant")
    @ResponseBody
    public Object yangHaikunlistMerchant() {
        return yangHaikunMerchantMapper.selectAll();
    }
}